function updateAdminLogged(link) {
	$('.members-list').html('');
	$
			.ajax({
				type : "POST",
				url : link + "/ajax/getAdminLogged",
				dataType : "json",
				cache : false,
				success : function(result) {
					for ( var i = 0; i < result.length; i++) {
						$('.members-list')
								.prepend(
										'<li><img width="48" height="48" src="'
												+ link
												+ 'resources/images/avatar/'
												+ result[i].avatar
												+ '" alt="" /><h5><a href="#" title="View round">'
												+ result[i].username
												+ '</a></h5><p class="member-info">Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet</p><span></span></li>');
					}
				}

			});
}

function getObjectByPage($link) {
	$('#content').load($link);
}

$(document).ready(function() {
	$("#product-table").tablesorter();
	
	
});

function sortByStatus(link, value) {

	// alert(link);

	$.post(link + "/changeStatus", {
		publish : value
	}, function(data) {
		// alert(data);
		if (data != 'false') {
			$('#content').load(link + "/index");
		} else {
			alert('failed');
		}
	});

}

function test(){
	//alert('toi day');
	var url = "http://localhost:8080/ctvlife/admin/vi/product/test";

	// Utilize the JQuery's JSON function
	$.getJSON(url, function(data){
	    
	    //Make sure it processed it okay.
	    /*if(data.Locations[0].Status == "OK"){
	        
	        //Parse the JSON
	        var location = data.Locations[0]
	        var city = location.City;
	        var country = location.CountryName;
	        var region = location.RegionName
	        
	        var output = "Your location is: "+ city+ ", "+region+ " "+ country;
	        
	        //OUTPUT
	        $('#content').html(output);
	    }*/
		
		alert(data.timeZone);
	    
	});
	
}